package com.example.service;

import com.example.dao.AdminDao;
import com.example.entity.Admin;

import com.example.entity.Admin;

import java.sql.SQLException;

public class AdminService {
    AdminDao adminDao = new AdminDao();

    public Admin getAdminByNameAndPwd(String username,String pwd) throws SQLException {
        if(username.isEmpty() || pwd.isEmpty()){
            return null;
        }else{
            Admin admin = new Admin();
            admin.setAdmin_name(username);
            admin.setAdmin_password(pwd);
            return adminDao.getAdminbyNamePwd(admin);
        }
    }
}
